package JVM;

import java.util.ArrayList;
import java.util.List;

// java.lang.OutOfMemoryError
public class HeapOOM {
    static class OOMObject{
        //1MB内存
        public byte[] byt = new byte[1*1024*1024];
    }

    public static void main(String[] args) {
        List<OOMObject> list = new ArrayList<>();
        while(true){
            list.add(new OOMObject());
        }
    }



}
